<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js绑定</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <h1>单向绑定</h1>
    <div id="root">
        <h2>{{text}}</h2>
        <input type="text" name="" v-bind:value="text" id="">
    </div>

    <h1>双向绑定</h1>
    <div id="root2">
        <h2>{{text}}</h2>
        <input type="text" name="" v-model:value="text" id="">
    </div>

</body>
<script>
    new Vue({
        el: "#root",
        data: {
            text: "hello vue"
        }
    })

    new Vue({
        el: "#root2",
        data: {
            text: "hello vue"
        }
    })
</script>

</html>